//
//  WeekPageCell.m
//  MindBox
//
//  Created by MS on 16-1-15.
//  Copyright (c) 2016年 Lemon. All rights reserved.
//

#import "WeekPageCell.h"
#import "UIImageView+WebCache.h"
@interface WeekPageCell ()
@property (weak, nonatomic) IBOutlet UIImageView *imgView;
@property (weak, nonatomic) IBOutlet UILabel *title;
@property (weak, nonatomic) IBOutlet UILabel *priceTitle;





@end

@implementation WeekPageCell

+(instancetype)cellWithcollectionView:(UITableView *)tableView
{
    
    NSString * className = NSStringFromClass([self class]);
    UINib *  nib = [UINib nibWithNibName:className bundle:nil];
    [tableView registerNib:nib forCellReuseIdentifier:className];
    return [tableView dequeueReusableCellWithIdentifier:className];
    
}


-(void)setItem:(Gift_ItemGoods *)item
{
    _item = item;
    
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:item.image_url]];
    
    self.title.text = item.short_name;
    
    NSString * priceStr = [NSString stringWithFormat:@"¥ %.2f",[item.p_price floatValue]];
    self.priceTitle.text = priceStr;
    
}

- (void)awakeFromNib {
   
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    _rankBaseView.layer.cornerRadius = _rankBaseView.frame.size.height*0.5;
    _rankBaseView.clipsToBounds = YES;
    
    _rankBaseView.layer.borderWidth = 0.5;
    _rankBaseView.layer.borderColor = [[UIColor redColor] CGColor];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
